<template>
  <div class="zy-content">
    <div class="toolBox" v-if="listArr && listArr.length">
      <div class="toolList">
        <template v-for="item in listArr">
         <Row>
           <Col span="6" style="padding: 6px;">
             <div class="listItem">
               <div class="itemTtile">
                 <span>{{$t('maintenance.Materialno')}}</span>
                 <span>{{item.toolCode}}</span>
               </div>
               <div class="item_text">
                 <span class="textGray">{{$t('maintenance.ToolName')}}</span>
                 <span class="textBlack">{{item.toolName}}</span>
               </div>
               <div class="item_text">
                 <span class="textGray">{{$t('maintenance.MaintenanceMethod')}}</span>
                 <span class="textBlack">{{item.toolMode}}</span>
               </div>
             </div>
           </Col>
         </Row>
        </template>
      </div>
    </div>
    <div class="noneList" v-else>
                   <span class="img_box">
                     <img src="@/assets/imgs/maintenance/nonelist.png"/>
                   </span>
      <span class="noneListText">{{$t('maintenance.noData')}}</span>
    </div>
    <div class="box_footer">
      <span class="btn" @click="$router.go(-1)">返回</span>
    </div>
  </div>
</template>

<script>
import { getDatatools } from '@/api/maintenance'
export default {
  name: "usetools",
  data(){
    return{
      offsetNumber:1,
      listArr:[],
    }
  },
  mounted() {
    this.getDatalist()
  },
  methods:{
    getDatalist(){
      this.listArr = []
      const { itemId,taskId } = this.$route.query
      getDatatools({ itemId,taskId }).then(res=>{
        if (res.data.toolList && res.data.toolList.length){
          this.listArr = this.listArr.concat(res.data.toolList)
        }
      })
    }
  }
}
</script>

<style scoped lang="scss">
@import "index.scss";
</style>
